Skip to content

Exclude internal documentation from search index#1449

Open
sinelaw wants to merge 4 commits intomasterfrom
claude/exclude-internal-docs-search-HSzcK
Open

Exclude internal documentation from search index#1449
sinelaw wants to merge 4 commits intomasterfrom
claude/exclude-internal-docs-search-HSzcK

Conversation

@sinelaw
Copy link
Copy Markdown
Owner

@sinelaw sinelaw commented Apr 1, 2026

Summary

Updated the VitePress search configuration to exclude internal documentation pages from the search index by implementing a custom render function.

Changes

  • Modified the search provider configuration from a simple string to an object with options
  • Added a custom _render function that filters out pages in the internal/ directory
  • Pages matching the internal/ path prefix now return empty strings instead of being indexed, effectively removing them from search results

Implementation Details

The custom render function intercepts the markdown rendering process and checks if the document's relativePath starts with "internal/". If it does, an empty string is returned instead of the rendered HTML, preventing those pages from appearing in search results while keeping them accessible via direct navigation.

https://claude.ai/code/session_01WnDaJ4qzuJiQaAkkmjkUnd

claude added 4 commits April 1, 2026 12:45
Internal design/planning docs were showing up in the public docs search.
Use the _render hook to return empty content for pages under internal/,
effectively removing them from the search index.

https://claude.ai/code/session_01WnDaJ4qzuJiQaAkkmjkUnd
Skip the md.render() call entirely for internal docs pages
rather than rendering then discarding.

https://claude.ai/code/session_01WnDaJ4qzuJiQaAkkmjkUnd
Shows content excerpts with highlighted matching terms in the search
popup, making it easier to evaluate results at a glance.

https://claude.ai/code/session_01WnDaJ4qzuJiQaAkkmjkUnd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants